<% include ../inc/head.ejs%>
<style>
    .form-group{
        margin-top:2rem;
    }
</style>
<div class="container">
    <form action="/articles/add" method="post"  role="form" class="form-horizontal" enctype="multipart/form-data">
        <div class="form-group">
            <label for="title" class="col-sm-2 control-label">标题</label>
            <div class="col-sm-10">
                <input type="text" value="" class="form-control" id="title" name="title" placeholder="标题"/>
            </div>
        </div>
        <div class="form-group">
            <label for="cat" class="col-sm-2 control-label">文章分类</label>
            <div class="col-sm-10">
                <select class="form-control" name="cat" id="cat" >
                    <option>-请选择-</option>
                    <% catData.forEach(function(item){ %>
                    <option value="<%=item._id%>-<%=item.cat_name%>"><%=item.cat_name%></option>
                    <%});%>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label for="intro" class="col-sm-2 control-label">简介</label>
            <div class="col-sm-10">
                <textarea class="form-control"   id="intro" cols="30" rows="5" id="intro" name="intro" placeholder="请输入简介，不能少于20个字符！"></textarea>
            </div>
        </div>
        <div class="form-group">
            <label for="is_md" class="col-sm-2 control-label">md格式</label>
            <div class="col-sm-10">
                <div class="checkbox">
                    <label>
                        <input type="checkbox" name="is_md" value="是">正文md格式请打勾
                    </label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label for="content" class="col-sm-2 control-label">正文</label>
            <div class="col-sm-10">
                <textarea class="form-control"   id="" cols="30" rows="10" id="content" name="content" placeholder="请输入内容"></textarea>
            </div>
        </div>
        <div class="form-group">
            <label for="img" class="col-sm-2 control-label">封面图片</label>
            <div class="col-sm-10">
                <input type="file" class="form-control"  name="img" id="img"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-success">提交</button>
                <button type="reset" class="btn btn-warning">重置</button>
            </div>
        </div>
    </form>
</div>
<% include ../inc/footer.ejs%>